#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDebug>
#include <QLabel>
#include <QThread>
#include "FramelessWindow.h"
#include "function.h"
#include "qcustomplot.h"
#include <QVBoxLayout>
#include <QColorDialog>
#include <qtmaterialtextfield.h>
#include <QDebug>
#include <qtmaterialflatbutton.h>
#include <QVBoxLayout>
#include <qtmaterialdialog.h>
#include <qtmaterialflatbutton.h>
#include <qtmaterialsnackbar.h>
#include <qtmaterialradiobutton.h>
#include <qtmaterialautocomplete.h>
#include <qtmaterialtabs.h>
#include <qtmaterialdrawer.h>
#include <qtmaterialcircularprogress.h>
#include <qtmaterialdrawer.h>
#include <QtConcurrent>
#include <QEventLoop>
#include <QTest>


#pragma execution_character_set("utf-8")

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public FramelessWindow
{
    Q_OBJECT

public:
    int userID;
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

signals:
  void mailButtonWaitting(QVector<QStringList> item); // 用于触发新线程中的耗时操作函数

public slots:
  void onReceivResult(const QString &str); // 接收新线程中的结果

private:
    QEventLoop eventloop;
    Ui::MainWindow *ui;
    QtMaterialDialog *m_dialog = new QtMaterialDialog;
    QtMaterialSnackbar *m_snackbar = new QtMaterialSnackbar;
    QLabel *contentWarm = new QLabel;
    QtMaterialTabs *tabs0 = new QtMaterialTabs;
    QtMaterialTabs *tabs1 = new QtMaterialTabs;
    QtMaterialTabs *tabs2 = new QtMaterialTabs;
    QList<QPixmap> topPixs;
    QtMaterialDrawer *drawer = new QtMaterialDrawer;
    QtMaterialCircularProgress *m_progress = new QtMaterialCircularProgress;
    QThread m_workThread;
    void warmingInit();
    void warming(QString title,QString content);
    void progressInit();
    void progressing();
    void endProgressing();
    void snackBarInit();
    void snackBar(QString text);
    void connectFun();
    void setBars(int property);
    void barsInit();
    void setTheme(int themeIndex);
    void customPlotInit(wayInfo info);
};
#endif // MAINWINDOW_H
